/// @description 鼠标事件
// You can write your code in this editor
show_debug_message("oView mb_event_"+string(view_mb_event_type));

if(view_show)
{
	//记录坐标
	if(view_is_gui)
	{
		var xx = camera_get_view_x(view_get_camera(view_current));
		var yy = camera_get_view_y(view_get_camera(view_current));
		
		tap_x = mouse_x-xx;
		tap_y = mouse_y-yy;
	}
	else
	{
		tap_x = mouse_x;
		tap_y = mouse_y;
	}

	//找到顶部view
	var child = id;
	var parent = child.view_parent;
	while(parent!=noone)
	{
		child = child.view_parent;
		parent = child.view_parent;
	}

	//处理事件
	with(child)
	{
		tap_x = other.tap_x;
		tap_y = other.tap_y;
	
		if(view_show)
		{
			//如果在区域内，进行处理
			if(tap_x>x&&tap_x<x+view_width&&tap_y>y&&tap_y<y+view_height)
			{
				event_user(view_mb_event_type);
				//自己拦截事件
				if(view_event_re[view_mb_event_type])
					return false;
				else //交给子控件事件处理判断
				{
					sai_scrViewEvent(view_mb_event_type, tap_x, tap_y);
				}
			}
		}
	}
}

